import {createRouter, createWebHashHistory} from "vue-router";
 
// 1. 配置路由
let routes = [
    { path: '/', redirect: '/login' },
    {
        path: '/login', component: () => import('../view/home.vue')
    },
    {
        path:'/nav',component: () => import('../view/nav.vue'),redirect: '/nav/page1' ,
        children:[
            {path:'/nav/page1',component: () => import('../view/page1.vue')},
            {path:'/nav/page2',component: () => import('../view/page2.vue')}
        ]
    }
 
];
// 2.返回一个 router 实列，为函数，配置 history 模式
const router = createRouter({
    history: createWebHashHistory(),
    routes,
});
 
// 3.导出路由   去 main.ts 注册 router.ts
 
export default router